package com.itqf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2021/1/21
 * @Time: 上午11:45
 */
@Controller
public class MyController  {

    @RequestMapping("/doLogin")
    public String login(String username, HttpSession session){
        //用户登录成功
        if (username.equals("admin"))
        {
            //记录登录状态
            session.setAttribute("user",username);
        }
        return  "welcome.jsp";
    }

    @RequestMapping("/cartList")
    public String   cartList(){
        System.out.println("cartList");
        return  "cartList.jsp";
    }

    @RequestMapping("/orderList")
    public String   orderList(){
        System.out.println("orderList");
        return  "orderList.jsp";
    }

}
